package com.wcy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.util.Objects;

import com.wcy.annotation.pageVo.PageColumn;
import com.wcy.annotation.pageVo.PageName;
import com.wcy.annotation.pageVo.SelectionAnnotation;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
 * <p>
 * 
 * </p>
 *
 * @author 吴传亿
 * @since 2025-04-28
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("user_learning_history")
@PageName(name = "用户学习记录")
public class UserLearningHistory {

    @PageColumn(isId = true,prop="historyId", label="学习记录ID",allowEdit = false)
    @TableId(value = "history_id", type = IdType.AUTO)
    private Integer historyId;

    @PageColumn(prop="userId", label="用户ID",type = "select",selectRef = @SelectionAnnotation(apiUrl = "user/list",mapProp = "userId",mapLabel = "username"))
    private Integer userId;

    @PageColumn(prop="resourceId", label="资源ID",type = "select",clickUrlPrefix = "detail/",selectRef = @SelectionAnnotation(apiUrl = "resource/list",mapProp = "resourceId",mapLabel = "title"))
    private Integer resourceId;

    @PageColumn(prop="accessedAt", label="访问时间",type = "date-picker")
    private LocalDateTime accessedAt;

    @PageColumn(prop="studyDuration", label="学习时长")
    private Integer studyDuration;
}
